@use './variables' as *;
@use './colors.module.scss' as *;
@use './global' as *;

.collapsible {
  padding-left: 0;
  list-style-type: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  border-left: 1px solid var(--md-sys-color-outline-variant);
  margin: $element-top-margin 0 $element-bottom-margin 0;
  @extend .z-depth-1;
}

.collapsible-header {
  display: flex;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  padding: 1rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);

  &:focus {
    outline: 0
  }

  i {
    width: 2rem;
    font-size: 1.6rem;
    display: inline-block;
    text-align: center;
    margin-right: 1rem;
  }
}

.collapsible-header::after {
  content: '\e5cf';
  margin-left: .5rem;
  font-family: 'Material Symbols Outlined', 'Material Symbols Rounded', 'Material Symbols Sharp', 'Material Icons';
  font-size: 25px;
  line-height: .9;
  -webkit-font-smoothing: antialiased;
}

.active .collapsible-header::after {
  content: '\e5ce';
}

.keyboard-focused .collapsible-header:focus {
  background-color: rgba(0, 0, 0, 0.12);
}

.collapsible-header-content {
  flex-grow: 1;
}

.collapsible-body {
  max-height: 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  box-sizing: border-box;
  padding: 0 2rem;
  overflow: hidden;
}

// Popout Collapsible

.collapsible.popout {
  border: none;
  box-shadow: none;

  > li {
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
    // transform: scaleX(.92);
    margin: 0 24px;
    transition: margin .35s cubic-bezier(0.250, 0.460, 0.450, 0.940);
  }

  > li.active {
    box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
    margin: 16px 0;
    // transform: scaleX(1);
  }
}
